import axios from '@/libs/api.request'

// 角色列表
export const getRolesList = () => {
  return axios.request({
    url: '/api/Roles',
    params: {},
    method: 'get'
  })
}

// 总数
export const getNumberList = (params) => {
  return axios.request({
    url: '/api/Statistics',
    params: params,
    method: 'get'
  })
}

// 删除角色
export const deleteRoles = (id) => {
  return axios.request({
    url: '/api/Roles/' + id,
    method: 'delete'
  })
}

// 获取等级
export const getAlarmLevel = () => {
  return axios.request({
    url: '/api/Alarm/AlarmLevel',
    params: {},
    method: 'get'
  })
}

// 获取等级
export const CreateRoles = (params) => {
  return axios.request({
    url: '/api/Roles/Insert',
    params: params,
    method: 'post'
  })
}

// 修改角色
export const updateRoles = (params) => {
  return axios.request({
    url: '/api/Roles/Update',
    params: params,
    method: 'post'
  })
}

// 根据角色ID获取配置信息
export const GetRoleSetInfo = (id) => {
  return axios.request({
    url: '/api/Roles/RoleSetInfo',
    params: { roleID: id },
    method: 'get'
  })
}

// 配置权限 获取所有菜单和按钮
export const GetFunction = () => {
  return axios.request({
    url: '/api/Function/GetFunction',
    method: 'get'
  })
}

// 修改菜单状态
export const SetRoleFunction = (params) => {
  return axios.request({
    url: '/api/Function/SetRoleFunction',
    params: params,
    method: 'post'
  })
}

// 修改按钮状态
export const SetRoleFunctionPara = (params) => {
  return axios.request({
    url: '/api/Function/SetRoleFunctionPara',
    params: params,
    method: 'post'
  })
}
